import {INCREMENT} from "./Mutations-types";

export default {
  //方法   有一个默认参数state
  [INCREMENT](state){
    state.counter++
  },
  decrement(state){
    state.counter--
  },
  //普通的接收
  // incrementcount(state,count){
  //   state.counter += count
  // },

  //特殊的接收
  incrementcount(state,payload){
    state.counter += payload.counter
  },
  addStudent(state,stu){
    state.students.push(stu)
  },
  updateinfo(state){
    state.info.name='coderwhy'
    //不能在这里进行异步操作
    // setTimeout(()=>{
    //   state.info.name = 'coderwhy'
    // },1000)
  }
}
